package com.ellwood.IPGuard.common.core.model.pojo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

/**
 * @ProjectName: IPGuard-boot
 * @PackageName: com.ellwood.IPGuard.common.core.model.pojo
 * @ClassName: EllPage
 * @Description: // 查询公共参数以及分页基础信息
 * @Author: Ellwood
 * @CreateDate: 2024/9/30 - 上午10:16
 * @Version: V1.0.0
 */
@Data
public class EllPage {
        
        @NotNull(message = "页码不能为空")
        @Min(value = 1, message = "页码不能小于1")
        @Schema(description = "当前页码", required = true)
        private Integer page;
        
        @NotNull(message = "每页条数不能为空")
        @Range(min = 1, max = 1000, message = "每页条数，取值范围 1-1000")
        @Schema(description = "每页条数", required = true)
        private Integer limit;
        
        @Schema(description = "是否降序排序")
        private String order;
        
        @Schema(description = "是否升序排序")
        private boolean asc;
        
}
